
-- Add a new custom error message
-- (Starts with 8000, check free error id's first!)

DECLARE @intErrMID INT

SET @intErrMID = 80000 -- Custom Error Id

/*
Check for free error id's...
SELECT TOP 10 * from vzErrorMessage ORDER BY ErrMID DESC
*/

EXEC pzErrorMessage_Load
  @vintErrMID         = @intErrMID,  -- Error No
  @vintSysLID         = 1033,        -- English
  @vtxtMessage        =              -- Error Text


EXEC pzErrorMessage_Load
  @vintErrMID         = @intErrMID,  -- Error No
  @vintSysLID         = 1031,        -- German
  @vtxtMessage        =              -- Error Text

--------------------------------------------------------------------------------------------------

-- Easy example how to create a cursor
DECLARE @strUserName NVARCHAR(128)

DECLARE CUR_ CURSOR LOCAL FAST_FORWARD FOR 
SELECT UserName FROM tzUser
OPEN CUR_
 
FETCH NEXT FROM CUR_
INTO @strUserName 
  

WHILE @@FETCH_STATUS = 0
BEGIN

    SELECT @strUserName
    FETCH NEXT FROM CUR_ INTO @strUserName 

END

CLOSE CUR_
DEALLOCATE CUR_


--------------------------------------------------------------------------------------------------




